====================================================================
Nail Gun
Model and Texture by Rockstar North
Edited to work as a firearm by X42.0
Nail Gun sound credit goes to whoever recorded/created it
====================================================================

Note: I am assuming for the most part that the reader does not know how to install mods for GTAIV, so I try to explain each step very thoroughly to avoid any confusion!

==================
INSTALLING THE GUN
==================

-Download OpenIV (google it) if you don't have it
-Run OpenIV, go to models>cdimages at the left, and double click on weapons.img at the right
-Click on Edit Mode near the top, or else you can't change anything
-Find and select both w_glock.wdr and w_glock.wtd, and click Edit>Export. Export them somewhere safe as backup. 
-Click the green +, navigate to the folder my mod is in, select both w_glock.wdr and w_glock.wtd, and hit enter.
-Double click on w_glock.wdr and the gun should show up correctly.

You now have the gun model and textures installed, but you aren't done yet!


=====
SOUND (If you don't care about/are too lazy to install the gunshot sound skip down to WEAPONINFO. But I highly recommend this as a nailgun that sounds like a real gun is a bit crazy!)
=====

-Download GTA-IVaud and run it
-Follow the SparkIV steps above to get to RESIDENT\WEAPONS.ivaud and EXPORT it (keep this window open for later)
-Open the exported WEAPONS.ivaud in GTA-IVaud
-Click on PISTOL_SHOT1_L.wav, then click Edit>Import WAV, and navigate to where the Nail Gun sounds are.
-Double click on PISTOL_SHOT1_L.wav and click yes to any messages that pop up
-Repeat the last 2 steps for PISTOL_SHOT1_R.wav and PISTOL_SHOT2.wav
-Save
-Now you have to Import the recently saved WEAPONS.ivaud in SparkIV, and remember to SAVE!


==========
WEAPONINFO
==========

Go to Common\Data\Weaponinfo.xml, make a copy of it for backup, right click on it and hit properties, untick "Read Only" and hit apply. Open it in the text editor of your choice (Notepad++ ftw). Scroll down until you find <weapon type="PISTOL">. 
Replace all the lines from <weapon type="PISTOL"> to </weapon> with the following:


	<weapon type="PISTOL">
		<data slot="HANDGUN" firetype="DELAYED_HIT" damagetype="BULLET" group="PISTOL_SMALL" targetrange="22.0" weaponrange="15.0" clipsize="50" ammomax="1500" timebetweenshots="133">
			<damage base="12" fps="15" networkplayermod="3.0" networkpedmod="1.0"/>
			<physics force="0.01"/>
			<reload time="2000" fasttime="2000" crouchtime="2000"/>

			<aiming accuracy="1.5">
				<offset x="0.15" y="1.0" z="0.55"/>
				<crouchedoffset x="0.2" y="1.0" z="0.05"/>
				<reticule standing="0.65" ducked="0.55" scale="0.3"/>
			</aiming>

			<pickup regentime="120000" ammoonstreet="30"/>

			<controller>
				<rumble duration="110" intensity="0.02"/>
			</controller>

			<flags>
				<flag>GUN</flag>
				<flag>CAN_AIM</flag>
				<flag>ANIM_RELOAD</flag>
				<flag>CAN_FREE_AIM</flag>
				<flag>ANIM_CROUCH_FIRE</flag>
				<flag>SILENCED</flag>
			</flags>
		</data>

		<assets model="w_glock">
			<anim group="gun@handgun" meleegroup1="firearm_core">
				<rates firerate="4" blindfirerate="4"/>
			</anim>
		</assets>
	</weapon>

To change rate of fire if you think it is a bit insane, change the values in <rates firerate="4" blindfirerate="4"/> to a lesser value, such as 3.5